package com.example.mobile2121606110syc0430homework;

import android.os.Bundle;
import android.widget.TextView;

import androidx.appcompat.app.AppCompatActivity;
import androidx.recyclerview.widget.LinearLayoutManager;
import androidx.recyclerview.widget.RecyclerView;

public class MainActivity extends AppCompatActivity {

    private TextView tvMainTittle;
    private RecyclerView rvMainPart;
    private int[] partId={
            R.drawable.line01_01,R.drawable.line01_02,R.drawable.line01_03,R.drawable.line01_04,R.drawable.line01_05,
            R.drawable.line01_06,R.drawable.line01_07,R.drawable.line01_08,R.drawable.line01_09,R.drawable.line01_10,
            R.drawable.line01_11,R.drawable.line01_12,R.drawable.line01_13,R.drawable.line01_14,R.drawable.line01_15,
            R.drawable.line01_16,R.drawable.line01_17,R.drawable.line01_18,R.drawable.line01_19,R.drawable.line01_20
    };
    private String[] partName={
            "轿车车型生产环节1","轿车车型生产环节2","轿车车型生产环节3","轿车车型生产环节4","轿车车型生产环节5",
            "轿车车型生产环节6","轿车车型生产环节7","轿车车型生产环节8","轿车车型生产环节9","轿车车型生产环节10",
            "轿车车型生产环节11","轿车车型生产环节12","轿车车型生产环节13","轿车车型生产环节14","轿车车型生产环节15",
            "轿车车型生产环节16","轿车车型生产环节17","轿车车型生产环节18","轿车车型生产环节19","轿车车型生产环节20"
    };
    private String[] partName2={
            "轿车汽车放置底盘","轿车汽车左前悬挂","轿车汽车右前悬挂","轿车汽车左后悬挂","轿车汽车右后悬挂",
            "轿车汽车固定车架","轿车汽车发动机","轿车汽车汽车椅子","轿车汽车方向盘","轿车汽车左前车门",
            "轿车汽车右前车门","轿车汽车左后车门","轿车汽车右后车门"
    };

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        initView();
        rvMainPart.setLayoutManager(new LinearLayoutManager(this));
        PartRViewAdapter adapter=new PartRViewAdapter(partId,partName,partName2);
        rvMainPart.setAdapter(adapter);
    }

    private void initView() {
        tvMainTittle = (TextView) findViewById(R.id.tvMainTittle);
        rvMainPart = (RecyclerView) findViewById(R.id.rvMainPart);
    }
}